var path = require('path')
var webpack = require('webpack')
// 多页面应用+第三方插件
module.exports = {
  entry: {
    'pageA':'./src/pageA',
    'pageB':'./src/pageB',
    'vendor':['lodash']
  },
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: '[name].bundle.js',
    chunkFilename:'[name].chunk.js'
  },
  plugins: [
    new webpack.optimize.CommonsChunkPlugin({
      name: 'common',
      minChunks: 2,
      chunks:['pageA','pageB']
    }),
    new webpack.optimize.CommonsChunkPlugin({
      names: ['vendor','manifest'],
      minChunks: Infinity
    })
  ]
}